using System;
using log4net;

public static class ILogExtensions {
    public static string LogPrefix = "[X]";
    public static int idx = 1;
    private static log4net.ILog log =
        log4net.LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType);

    private static void usage() {
        log.Debug("usage");
    }

    public static void Trace(this ILog log, string message, Exception exception) {
        log.Logger.Log(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType,
                       log4net.Core.Level.Trace, message, exception);
        UnityEngine.Debug.Log(LogPrefix + (idx++) + message);
    }

    public static void Trace(this ILog log, string message) {
        log.Trace(message, null);
    }

    public static void Verbose(this ILog log, string message, Exception exception) {
        log.Logger.Log(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType,
                       log4net.Core.Level.Verbose, message, exception);
        UnityEngine.Debug.Log(LogPrefix + (idx++) + message);
    }

    public static void Verbose(this ILog log, string message) {
        log.Verbose(message, null);
    }
}